<?php

/*
 * Create by Indonesian Brain Solutions
 * E-mail : cs@mesinit.com
 * Programmer : sony@sonywibisono.com
 */
class Tickettypes {
    var $id;
var $ticket_type;


    function open(){
        global $db;
        $sql="select * from ticket_types where id=$id";
        $row=$db->fetch_row($sql);
        if (!empty($row)){
            extract($row);
            $this->ticket_type=$ticket_type;

        }
    }

    function openAll(){
        $sql="select * from ticket_types order by id asc";
        $result=$db->query($sql);
        return $db->fetch_array($result);
        
    }

    function insert(){
    global $db;
    $sql="insert into ticket_types values (null,'{$this->ticket_type}')";
    $db->query($sql);
    return mysql_insert_id();
    }

    function update(){
        global $db;
        $sql="update ticket_types set ticket_type='{$this->ticket_type}'
 where id={$this->id}";
        $db->query($sql);
    }

    function delete(){
        global $db;
        $sql="delete from ticket_types where id=".$this->id;
        $db->query($sql);
    }

}
?>
